/***********************************************************************
** Copyright (C) 2011 Anthony Naddeo <anthony.naddeo@gmail.com>
**
** This file is part of LinkedUp
**
** LinkedUp is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**
** LinkedUp is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this package; If not, see <http://www.gnu.org/licenses/>.
**
***********************************************************************/
import QtQuick 1.1
import com.meego 1.0
import "../components"

Item{
	id: root
	width: parent.width
	height: rootColumn.height

//	Component.onCompleted: ListView.view.height = height

//	property bool bookmarked: User.bookmarked(id) ? true : false

	//	signal bookmark(string id)
	//	signal unbookmark(string id)
	////	signal finance(string tickerSymbol)
	//	signal news(string companyName)

	Component{
		id: section
		Section{}
	}

	Column{
		id: rootColumn
		width: root.width
		spacing: 20

		Component.onCompleted: {
			if(type)
				var typeSec = section.createObject(rootColumn, {"titleText":"Job Type", "contentText":type})
			if(experience)
				var expSec = section.createObject(rootColumn, {"titleText":"Experience", "contentText":experience})
			if(location)
				var locSec = section.createObject(rootColumn, {"titleText":"Location", "contentText":location})
			if(description)
				var desSec = section.createObject(rootColumn, {"titleText":"Description", "contentText":description})
		}

		Image {
			id: image
			height: 100
			width: 200
			fillMode: Image.PreserveAspectFit
			source: logoUrl || "qrc:///qml/images/profile-picture.png"
			smooth: true
			anchors.horizontalCenter: parent.horizontalCenter
		}

		Section{
			titleText: "Job Posting"
			contentText: '<a href="'+jobUrl+'">'+jobUrl+'</a>'
			onLinkActivated: Qt.openUrlExternally(link)
		}

//		Text {font.pixelSize: 20; wrapMode: Text.Wrap; width: root.width-10; color: palette.text; text: description}



//		Label {
//			font.pixelSize: 20;
//			font.family: "Arial";
//			color: palette.text;
//			text: '<a href="'+jobUrl+'">'+jobUrl+'</a>'
//			onLinkActivated: Qt.openUrlExternally(link)
//		}

//		Label {
//			font.pixelSize: 20;
//			font.family: "Arial";
//			wrapMode: Text.Wrap;
//			width: parent.width-10;
//			color: palette.text;
//			text: "Type: "+ type
//		}

//		Label {
//			font.pixelSize: 20;
//			font.family: "Arial";
//			wrapMode: Text.Wrap;
//			width: parent.width-10;
//			color: palette.text;
//			text: "Experience: " + experience
//		}

//		Label {
//			font.pixelSize: 20;
//			font.family: "Arial";
//			wrapMode: Text.Wrap;
//			width: parent.width-10;
//			color: palette.text;
//			text:  location
//		}



		//			Row{//two rows for buttons becuase the follow button grows large
		//				id: buttonRow
		////				Button{
		////					id: financeButton
		////					enabled: ticker ? true : false
		////					iconSource: "qrc:///qml/images/stock-small.png"
		////					onClicked: root.finance(ticker)
		////				}
		////				Button{
		////					id: newsButton
		////					iconSource: "qrc:///qml/images/news-small.png"
		////					onClicked: root.news(name)
		////				}
		//			}

		//			Row{
		//				Button{
		//					id: bookmarkButton
		//					text: bookmarked ? "Bookmarked " + name : "Bookmark " + name
		//					//				   onClicked: following ? root.stopFollow(id) : root.follow(id) //mm uncomment this when xmlhttp delete is implemented
		//					onClicked: root.bookmark(id)
		//					iconSource: bookmarked ? "qrc:///qml/images/star-on.png" : "qrc:///qml/images/star-off.png"
		//					//				   Behavior on text { NumberAnimation{ duration: 250}}
		//				}
		//			}

	}







}
